package com.jeesite.modules.isys.keys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.jeesite.modules.isys.keys.entity.Lab;
import com.jeesite.modules.isys.keys.mapper.LabMapper;
import com.jeesite.modules.isys.keys.service.ILabService;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author XYMTOP
 * @since 2023-11-12
 */
@Service
public class LabServiceImpl extends ServiceImpl<LabMapper, Lab> implements ILabService {

    @Autowired
    private LabMapper labMapper;


    @Override
    public void updateLabStatus(String labId) {
        UpdateWrapper<Lab> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("lab_id", labId).set("lab_status", 1);
        labMapper.update(null, updateWrapper);
    }

    @Override
    public int getLabStatus(String labId) {
        return labMapper.selectById(labId).getLabStatus();
    }
}
